package cn.wolfcode.controller;

import cn.wolfcode.query.JsonResult;
import cn.wolfcode.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/permission")
public class ReloadController {

    @Autowired
    private IPermissionService permissionService;

    @RequestMapping("/reload")
    @ResponseBody
    public JsonResult reload(){
        try {
            permissionService.reload();
            return new JsonResult();
        } catch(Exception e) {
            e.printStackTrace();
            return new JsonResult("加载失败",false);
        }

    }
}
